|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectga.core.goperators.ProbabilityOp
public abstract class ProbabilityOp
Abstract class for a probability operator.
Field Summary | |
---|---|
private int |
pOperation
|
private java.util.Random |
rnd
|
Constructor Summary | |
---|---|
ProbabilityOp(int pOperation)
Initializes the operator with the given probability. |
Method Summary | |
---|---|
boolean |
doOperate()
Calculates by internal probability and random number if the operator should operate. |
boolean |
doOperate(int probability)
Calculates by given probability and random number if the operator should operate. |
protected java.util.Random |
getRandom()
Getter for the random. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final int pOperation
private final java.util.Random rnd
Constructor Detail |
---|
public ProbabilityOp(int pOperation)
pOperation
- The probability.Method Detail |
---|
public boolean doOperate()
true
if probability met.public boolean doOperate(int probability)
probability
- The probability.
true
if probability met.protected java.util.Random getRandom()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |